package com.bloveoacom.weichi.model;


import com.bloveoacom.base.UserInfoBean;
import com.bloveoacom.http.HttpMethods;
import com.bloveoacom.http.HttpResult;
import com.bloveoacom.weichi.bean.Comment2Bean;
import com.bloveoacom.weichi.bean.CommentBean;
import com.bloveoacom.weichi.bean.PostDetailBean;
import com.bloveoacom.weichi.bean.RewardBean;
import com.bloveoacom.weichi.bean.UserBean;
import com.bloveoacom.weichi.contract.PostDetailContract;

import java.util.List;

import io.reactivex.Flowable;

/**
 * author: zhu.px
 * e-mail: 1271901673@qq.com
 * time  : 2018/8/22
 * desc  : 我的
 */
public class PostDetailModel implements PostDetailContract.Model {



    @Override
    public void onDestroy() {

    }


    @Override
    public Flowable<HttpResult<PostDetailBean>> getCoinNewsDetail(String coinId) {
        return HttpMethods.getInstance().getHttpService().getCoinNewsDetail(UserInfoBean.getInstance().getToken(),coinId);
    }

    @Override
    public Flowable<HttpResult<Comment2Bean>> getCommentList(int pageNum, int pageSize, String coinId) {
        return HttpMethods.getInstance().getHttpService().getCommentList(pageNum,pageSize,coinId);
    }

    @Override
    public Flowable<HttpResult<RewardBean>> comment(String coinId, String replyCommentId, String replyUserId, String type, String content, String sign) {
        return HttpMethods.getInstance().getHttpService().comment(coinId,content,UserInfoBean.getInstance().getToken(),replyUserId,type,replyCommentId,sign);
    }


    @Override
    public Flowable<HttpResult<Object>> userFocus(String targetUserId, int type) {
        return HttpMethods.getInstance().getHttpService().userFocus(UserInfoBean.getInstance().getToken(),targetUserId,type);
    }

    @Override
    public Flowable<HttpResult<Object>> goCollection(String coinId, int type, int isCollect) {
        return HttpMethods.getInstance().getHttpService().goCollection(UserInfoBean.getInstance().getToken(),coinId,type,isCollect);
    }

    @Override
    public Flowable<HttpResult<RewardBean>> collect(String objectId, int type, int isCollected) {
        return HttpMethods.getInstance().getHttpService().collect(objectId,type,isCollected,UserInfoBean.getInstance().getToken());
    }

    @Override
    public Flowable<HttpResult<Object>> findTimeStamp() {
        return HttpMethods.getInstance().getHttpService().findTimeStamp(UserInfoBean.getInstance().getToken());
    }

    @Override
    public Flowable<HttpResult<Object>> fenpeiEmt(String coind,String overType) {
        return HttpMethods.getInstance().getHttpService().fenpeiEmt(coind,overType);
    }
}
